package lunchy.util;

import java.io.File;

import org.hibernate.cfg.Configuration;
import org.hibernate.SessionFactory;

public class CLunchyHibernateUtil
{
	private static final SessionFactory sessionFactory;
	
	static
    {
		try
		{
			sessionFactory = new Configuration().configure(new File("hibernate.cfg.xml")).buildSessionFactory();
		}
		catch (Throwable ex)
		{
			throw new ExceptionInInitializerError(ex);
		}
	}

    public static SessionFactory getSessionFactory()
    {
    	return sessionFactory;
    }
}